package com.zzy.ecommerce.dao;

import com.zzy.ecommerce.domain.TAccount;

import java.util.List;

import com.zzy.ecommerce.domain.TOrder;
import com.zzy.ecommerce.domain.TUser;
import org.apache.ibatis.annotations.*;

@Mapper
public interface TAccountMapper {

    @Select("select * from t_account")
    List<TAccount> selectAllAccount();

    @Delete("delete from t_account where userId=#{userId}")
    Integer deleteOneAccount(Integer userId);

    @Delete("delete from t_account")
    Integer deleteAllAccounts();

    @Insert("update t_account set userName=#{username},passWord=#{password} where userId=#{userid}")
    Integer insertOneAccount(TAccount account);

    @Insert("insert into t_account(userId,userName,passWord) values(#{id},#{username},#{password})")
    Integer insertOneAccountByUser(TUser user);

    @Select("select * from t_account where userId=#{id}")
    TAccount selectOneAccount(Integer id);
}